package com.ff.neuropp.domain;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;

import org.springframework.format.annotation.DateTimeFormat;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.ff.neuropp.util.DateSerializer;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

@Data
@Entity
@Table(name = "t_pc_user", uniqueConstraints = {@UniqueConstraint(columnNames="id")})
/**
 *  pc端用户表
 * @author sun_weiwu
 *
 */
public class PcUser {
	 private static final long serialVersionUID = 1L;

	    @Id
	    @GeneratedValue(strategy = GenerationType.IDENTITY)
	    private int id;
	    
	    @Column(name = "user_id", columnDefinition = "varchar(100) COMMENT '用户Id'")
	    @ApiModelProperty(value = "用户Id")
	    private String userId;
	    

	    @Column(name = "user_name", columnDefinition = "varchar(100) COMMENT '用户名称'")
	    @ApiModelProperty(value = "用户名称")
	    private String userName;

	      
	    @Column(name = "password", columnDefinition = "varchar(100) COMMENT '密码'")
	    @ApiModelProperty(value = "密码")
	    private String password;
	    
	    @Column(name = "user_type", columnDefinition = "char(1) COMMENT '用户类型'")
	    @ApiModelProperty(value = "用户类型 1:学生 2:老师")
	    private String userType;
	    
	    @Column(name = "head_url", columnDefinition = "varchar(100) COMMENT '用户头像'")
	    @ApiModelProperty(value = "用户头像")
	    private String headUrl;
	    
	    
	    //操作时间
	    @Column(updatable = false)
	    @org.hibernate.annotations.CreationTimestamp
	    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	    @JsonSerialize(using = DateSerializer.class)
	    private Date create_date;
	    
	    @Column(name = "update_time", columnDefinition = "datetime COMMENT '更新时间'")
	    private Date updateTime;
	    
}
